package com.wuye.model;

import com.wuye.web.Constant;
import com.wuye.web.OrderState;
import com.wuye.web.PayMethod;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by jiawenlong on 2016/6/12.
 */
public class OrderDetail {

    public OrderDetail(){}
    public OrderDetail(Order order) {
        this.orderNum = order.getOrderNum();
        this.cellPhone = order.getCellPhone();
        this.userName = order.getUserName()==null ? "":order.getUserName();
        this.orderDate = Constant.sdf.format(order.getOrderDate()==null? new Date():order.getOrderDate());
        this.orderState = OrderState.valueOf(order.getOrderState()).getState();
        this.totalPrice = order.getTotalPrice();
        this.payMethod = PayMethod.valueOf(order.getPayMethod()).getPayMethod();
        this.memo = order.getMemo()==null ? "":order.getMemo();
    }

    private String orderNum;
    private String cellPhone;
    private String userName;
    private String orderDate;
    private String orderState;
    private Float totalPrice;
    private String payMethod;
    private String memo;
    private List<OrderItem> orderItems = new ArrayList<OrderItem>();

    public String getOrderNum() {
        return this.orderNum;
    }

    public void setOrderNum(String arg) {
        this.orderNum = arg;
    }

    public String getCellPhone() {
        return this.cellPhone;
    }

    public void setCellPhone(String arg) {
        this.cellPhone = arg;
    }

    public String getUserName() {
        return this.userName;
    }

    public void setUserName(String arg) {
        this.userName = arg;
    }

    public String getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(String orderDate) {
        this.orderDate = orderDate;
    }

    public String getOrderState() {
        return this.orderState;
    }

    public void setOrderState(String arg) {
        this.orderState = arg;
    }

    public Float getTotalPrice() {
        return this.totalPrice;
    }

    public void setTotalPrice(Float arg) {
        this.totalPrice = arg;
    }

    public String getPayMethod() {
        return this.payMethod;
    }

    public void setPayMethod(String arg) {
        this.payMethod = arg;
    }

    public String getMemo() {
        return this.memo;
    }

    public void setMemo(String arg) {
        this.memo = arg;
    }

    public List<OrderItem> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }
}
